/*
 * Create by erik on 18-8-21 下午5:11
 * Copyright (c) 2018. All rights reserved.
 *
 * Last Modified 18-8-21 下午5:11
 */

package com.feeyo.groundservice.jg

import android.content.Context
import cn.jpush.android.api.JPushInterface
import com.feeyo.groundservice.fpush.BasePushEngine
import com.feeyo.groundservice.fpush.PushBroadCast

class JgPushEngine : BasePushEngine {
    override fun init(context: Context) {
        JPushInterface.setDebugMode(true)
        JPushInterface.init(context)
        val regid = JPushInterface.getRegistrationID(context)
        println("jiguang regid:$regid")

        PushBroadCast.sendRegistration(context, regid, "jiguang")
    }

    override fun release(context: Context) {
        JPushInterface.stopPush(context)
    }

    override fun name(): String {
        return "jiguang"
    }
}